using System;
using System.Globalization;
using System.Reflection;
using ns20;

namespace Newtonsoft.Json.Serialization
{
	public class ReflectionValueProvider : IValueProvider
	{
		private readonly MemberInfo memberInfo_0;

		public ReflectionValueProvider(MemberInfo memberInfo)
		{
			Class204.smethod_2(memberInfo, "memberInfo");
			memberInfo_0 = memberInfo;
		}

		public void SetValue(object target, object value)
		{
			try
			{
				Class195.smethod_24(memberInfo_0, target, value);
			}
			catch (Exception innerException)
			{
				throw new JsonSerializationException("Error setting value to '{0}' on '{1}'.".smethod_1(CultureInfo.InvariantCulture, memberInfo_0.Name, target.GetType()), innerException);
			}
		}

		public object GetValue(object target)
		{
			try
			{
				return Class195.smethod_23(memberInfo_0, target);
			}
			catch (Exception innerException)
			{
				throw new JsonSerializationException("Error getting value from '{0}' on '{1}'.".smethod_1(CultureInfo.InvariantCulture, memberInfo_0.Name, target.GetType()), innerException);
			}
		}
	}
}
